#pragma once

#include <iostream>
#include <string>
#include <vector>
#include <semaphore.h>


template<typename T>
class RingQueue
{
public:
    RingQueue(int max_cap):_max_cap(max_cap),_ringqueue(max_cap),_c_step(0),_p_step(0)
    {
        sem_init(&_data_sem,0,0);
        sem_init(&_space_sem,0,max_cap);
    }

    void Push(const T &in)
    {

    }

    void Pop(T* out)
    {

    }

    ~RingQueue()
    {
        sem_destroy(&_data_sem);
        sem_destroy(&_space_sem);
    }

private:
    std::vector<T> _ringqueue;
    int _max_cap;

    int _c_step;
    int _p_step;

    sem_t _data_sem;//消费者关心
    sem_t _space_sem;//生产者关心
};